home *** CD-ROM | disk | FTP | other *** search
- # (decoded with TMPL 11972)
- { %filename% -- modeless dialog }
- { Created %date% %time% by AppMaker }
-
- Unit %unitname%;
- Interface
-
- Uses
- %If MPW%
- {$Load ToolBox.dump}
- MemTypes,
- QuickDraw,
- OSIntf,
- ToolIntf,
- PackIntf,
- {$Load}
-
- %end if%
- %If Think%
- {$ifc undefined Think_Pascal}
- ListManager,
- {$endc}
- %end if%
- ResourceDefs,
- DialogAids;
-
- Type
- %dlogname%Rec = record
- %DeclItems%
- end;
- %dlogname%Ptr = ^%dlogname%Rec;
- %dlogname%Handle = ^%dlogname%Ptr;
-
- Var
- %dlogname%Dialog: DialogPtr;
-
- {----------}
- Procedure Init%dlogname%;
- Procedure Do%dlogname%;
- Procedure Close%dlogname%;
- Function Filter%dlogname% (whichDialog: DialogPtr;
- var event: EventRecord;
- var itemHit: integer): boolean;
- Procedure Do%dlogname%Item (itemNr: integer);
-
- {----------}
- Implementation
-
- %If MPW%
- {$D+}
- {$R+}
- {$OV+}
-
- %end if%
- const
- %ConstItems%
-
- %If MPW%
- {$S %unitname%}
-
- %end if%
- %ItemProcs%
- {----------}
- Procedure Init%dlogname%;
- var
- theDialog: DialogPtr;
- %dlogname%Data: %dlogname%Handle;
- Begin
- %dlogname%Dialog := GetNewDialog (%dlogname%ID, nil, pointer (-1));
- theDialog := %dlogname%Dialog;
- SetPort (theDialog);
- %dlogname%Data := %dlogname%Handle (NewHandle (sizeof (%dlogname%Rec)));
- SetWRefCon (theDialog, longint (%dlogname%Data));
- HLock (Handle (%Dlogname%Data));
- with %dlogname%Data^^ do begin
- %InitFields%
- %SetItems%
- %EnableItems%
- end; {with}
- HUnlock (Handle (%Dlogname%Data));
- End; {Init%dlogname%}
-
- {----------}
- Procedure Do%dlogname%;
- Begin
- if %dlogname%Dialog <> nil then begin
- SelectWindow (%dlogname%Dialog);
- ShowWindow (%dlogname%Dialog);
- end; {if}
- End; {Do%dlogname%}
-
- {----------}
- Procedure Close%dlogname%;
- Begin
- HideWindow (%dlogname%Dialog);
- End; {Close%dlogname%}
-
- {----------}
- Function Filter%dlogname% {(whichDialog: DialogPtr;
- var event: EventRecord;
- var itemHit: integer): boolean};
- var
- filtered: boolean;
- Begin
- filtered := false;
- %FilterItems%
- if not filtered then begin
- filtered := StandardFilter (whichDialog, event, itemHit);
- end;
- Filter%dlogname% := filtered;
- End; {Filter%dlogname%}
-
- {----------}
- Procedure Do%dlogname%Item {(itemNr: integer)};
- Var
- theDialog: DialogPtr;
- %dlogname%Data: %dlogname%Handle;
- Begin
- theDialog := %dlogname%Dialog;
- SetPort (theDialog);
- %dlogname%Data := %dlogname%Handle (GetWRefCon (theDialog));
- HLock (Handle (%Dlogname%Data));
- with %dlogname%Data^^ do begin
- case itemNr of
- %HandleItems%
- end; {case}
- %EnableItems%
- end; {with}
- HUnlock (Handle (%Dlogname%Data));
- End; {Do%dlogname%Item}
-
- End. {%unitname%}
-
-